/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __LIB3D_CAMERADESC_H__
#define __LIB3D_CAMERADESC_H__

#include <lib3d/Math_lib3d.h>
#include <Color.h>
#include <math/Frustrum.h>
#include <math/Sphere.h>
#include <math/Box.h>
#include <properties/DependencyProperty.h>

namespace liba
{
namespace lib3d
{

class CameraDesc
{
public:
	Matrix projection;
	Matrix world;

	properties::DependencyProperty<double> near_plane;
	properties::DependencyProperty<double> far_plane;

	Viewport viewport;
	math::Frustrum frustrum;
	Color fog_color;
	/* fog_range == 0 is special case for no fog. (because it is difficult to use +inf as a float number */
	properties::DependencyProperty<double> fog_range;

	Matrix aureole_matrix;

	CameraDesc();
	bool is_sphere_visible( const math::Sphere & sphere );
	bool is_box_visible( const math::Box & box );
	/** px,py = [-1..1] */
	Ray get_ray(double px, double py)const;
};

} // namespace lib3d
} // namespace liba
using namespace liba;

#endif //__LIB3D_CAMERADESC_H__

